package cn.kgc.web.controller;

import cn.kgc.base.utils.ResponseResult;
import cn.kgc.web.dto.StudentDTO;
import cn.kgc.web.service.StudentService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author 课工场
 * @date 2024/1/11
 * @description
 */
@RestController
@RequestMapping("student")
public class StudentController {
    @Resource
    private StudentService studentService;

    //获取学生信息列表
    @GetMapping
    public ResponseResult  studentList(){
        return studentService.studentList();
    }

    // 添加学生信息
    @PostMapping
    public ResponseResult  addStudent(@RequestBody StudentDTO studentDTO){
        return studentService.addStudent(studentDTO);
    }
}
